<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8" />
	<title>下拉树控件</title>

	<link rel="stylesheet" type="text/css" href="../jquery.combotree.css" class="view-source">
	<link  href="../../../../themes/default/style.css" class="view-source" rel="stylesheet">
	<script src="../../../../scripts/jquery.js"  class="view-source" type="text/javascript"></script>
	<script src="../../../../scripts/common.js"  class="view-source" type="text/javascript"></script>
	<script src="../../../../scripts/browserfix.js"  class="view-source" type="text/javascript" ></script>
	<script src="../../../../scripts/plugins/jquery.json.js" type="text/javascript"></script>
	
	<script src="../../../../scripts/plugins/jquery.ui.js" class="view-source"  type="text/javascript" ></script>
	
	<script type="text/javascript" src="../jquery.combotree.js" class="view-source"></script>
	
	
	<script src="../../demo.js"></script>
	<link href="../../demo.css" rel="stylesheet">

<script class="view-source noparse">
	//数据格式：
	//{id:"",text:"",state:"",cancheck:"",children:[{...}]}
	$(function(){
		$('#getValue').click( function(){
			var obj = $('#cc').comboTree().getValue();
			$('.value').show().removeClass('ui-helper-hidden').html( jQuery.json.encode(obj) ) ;
		} ) ;
		
		$('#setValue').click( function(){
			$('#cc').comboTree().setValue({
				id:2,
				text:'File1'
			});
		} ) ;
		
		$('#reload').click( function(){
			$('#cc').comboTree().reload();
		} ) ;
	}) ;
</script>
	
</head>

<body>
	<form id="demoForm" action="#"  class="form-inline row-fluid " >

			<div class="row-fluid view-source control-group">
				<div class="span3">
	      			<a href='javascript:' id='getValue' class="btn">getValue</a> &nbsp;&nbsp;
					<a href='javascript:' id='setValue' class="btn">setValue</a> &nbsp;&nbsp;
					<a href='javascript:' id='reload' class="btn">reload</a>     &nbsp;&nbsp;
				</div>
				<div class="span3">
	      			<div class="value alert" style="display:none;"></div>
				</div>
	      	</div>
	      	
	      	<div class="row-fluid control-group">
      			<label class="control-label" for="agreement1">HTML声明式标签：</label>
	            <div class="controls" class="view-source">
	             	<select id="cc" class="view-source"  data-widget="combotree" data-options="{'url':'../tree_data.json'}" class="hide"></select>
	            </div>
	      	</div>

	  </form>
</body>
</html>